Repository navigation
fix(android): use 14.67 body size - #290
Merged
Merged
Conversation
`app.css` re-declared `.title-*` and `.body` font sizes on top of the imported Adwaita theme, and the vendored `adwaita.css` was a snapshot old enough to predate the theme's current sizes. The app therefore rendered a ramp that matched neither GTK nor the theme it imports. Resync the vendored copy from gjsify and keep only what is genuinely app-specific in `app.css`: the 12/12 margins and the `HtmlView` size. The ramp now comes from one place, so the next theme change arrives with the dependency bump instead of needing a second edit here. Measured on a Galaxy S9 (density 3.5, font_scale 1.0): code to prose line pitch 1.18 -> 0.98, against 1.00 on the GTK build.
JumpLink
force-pushed
the
fix/android-body-size
branch
from
November 10, 2026 23:21
999000c to
a010631
Compare
Two text surfaces got their size from somewhere no stylesheet can reach, so neither the theme nor anything layered on top of it could move them: - The code editor. `@gjsify/gtksource-nativescript` applies the resolved CSS `font-size` to the native `EditText` and falls back to its own `DEFAULT_FONT_SIZE` when no rule declares one. Nothing did. - The tutorial prose. The MDX compiler puts `paragraph` on every prose block; it is not an Adwaita class, so the theme does not carry it. On GTK an undeclared label inherits the document font and looks right, on NativeScript it falls through to the Android default text size. Both now state 14.67, the `.body` size they were meant to match.
On a phone the app draws every size for a 360 dp window, so on a wider screen it reads smaller than the same app does on the desktop. gjsify's new `@gjsify/adwaita-nativescript/app-scale` multiplies every length in the stylesheet by one factor; this is the app's half of it. `InterfaceScaleService` owns the stored value: the string key `interface-scale`, either `auto` or a factor such as `1.25`. It hands the PROCESSED stylesheet to `registerAppScaleCss` — `?inline`, not `?raw`, so Tailwind is expanded and the `@import`s are inlined — and applies before the theme service, which reappends the sheet whenever it rewrites the theme. The Preferences row is a combo: "Automatic (114%)" first, then 100% to 150% in tenths. Picking Automatic again IS the reset, so the group needs no second button. A stored factor that is not offered shows as its nearest entry. The row only exists where a scale service is passed in, so GNOME and web keep the dialog they had. Text and spacing follow immediately; icon sizes are baked at render time and follow after a restart, which the group description says.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Body, HtmlView and list text were 15 while the gjsify theme (GTK 11 pt at 96 dpi) uses 14.67.
The first commit aligned
app.cssand the vendoredadwaita.css.Second commit: stop re-declaring the ramp
app.csskept its own.title-*and.bodyfont sizes on top of the theme it imports, and thevendored
adwaita.csswas a snapshot old enough to predate the theme's current sizes — so the apprendered a ramp matching neither GTK nor the theme.
Now the vendored copy is resynced from gjsify (which gained the full libadwaita ramp in
gjsify/gjsify#2583) and
app.csskeeps only what is really app-specific: the 12/12 margins and anexplicit
HtmlViewsize. One source for the ramp, so the next theme change arrives with thedependency bump instead of needing a second edit here.
Visible side effect of the resync, worth knowing before merge:
.adw-preferences-group-title11 → 14.67 and
.adw-preferences-group-description12 → 14.67. The old values came from the stalesnapshot; gjsify's canonical theme wins. Checked on the device in light, dark and at
font_scale 1.3— no clipping, the groups just read at the size GTK uses.Device verification
Galaxy S9, Android 10, density 3.5, built against a locally linked gjsify that carries #2583.
Line pitch measured by row projection of the screenshots:
Matrix walked: light and dark, default palette plus a custom primary and a custom accent,
font_scale1.0 and 1.3, portrait and landscape plus a live rotation, Learn/Code/Debug/Play,keyboard open in the editor, Preferences, About and Details.
Checks:
check:format,check:lint,check:versionsall green.Needs a gjsify release containing gjsify/gjsify#2583 — this PR was verified against a
gjsify linkbuild, not a published version, so the dependency bump has to land before or with it.Second and third commit: the app's half of the interface scale
The prose pitch row above (62 px before, 62 px after) was the honest answer at the time and also
the clue: the tutorial's body text was not following the theme at all. The MDX compiler puts
paragraphon every prose block, it is not an Adwaita class, so the gjsify theme does not carryit — on GTK an undeclared label inherits the document font and looks right, on NativeScript it
falls through to the Android default text size, which no stylesheet reaches. Same shape as the
editor find in #2583, and the same fix:
packages/app-android/app/app.cssnow states 14.67 for.paragraphand for.gtksource-view(the classGtkSourceViewputs on itself, whose driverneeds a declared size or keeps its own
DEFAULT_FONT_SIZE).With that, every text surface is reachable from the stylesheet, which is what the interface scale
needs. gjsify's new
@gjsify/adwaita-nativescript/app-scale(third commit of gjsify/gjsify#2583)multiplies every length in the sheet — font sizes and paddings, min-heights, radii, icon boxes —
by one factor. This PR is the app's half:
InterfaceScaleServiceowns the stored value: gschema keyinterface-scaleas a string, eitherautoor a factor such as1.25. A stored factor that is not offered maps to its nearest entry.registerAppScaleCssviaimport appCss from "./app.css?inline"—?inline, not?raw, so Tailwind is expanded and the@imports inlined —and applies before
themeService.init, which reappends the sheet whenever it rewrites the theme.Automatic again is the reset, so the group needs no second button. The row only exists where a
scale service is passed in, so the GNOME and web dialogs are unchanged.
restart, which the group description states.
Device verification
Galaxy S9, density 3.5, 411.4 dp wide → derived factor 1.143. Measured at fresh starts:
The prose row before the
.paragraphfix: 62 px at 100% and 63 px at auto, while thetitle-2next to it grew 54 → 61. After it, the text band is 49 → 57 px tall and the pitch 66 → 74.
No double scaling with the system font size: at
font_scale 1.3and auto the editor pitch is85 px against 68 px.
Matrix walked again on the final build: light and dark, default palette plus a custom accent,
font_scale1.0 and 1.3, portrait and landscape plus a live rotation, all four pages, keyboardopen in the editor, Preferences, About and its Details page. No clipping.
Known limitation, not fixed here: the generated
.blpsetsmargin-top/bottom: 12directly oneach prose label, and in NativeScript a value set on the view wins over CSS, so those block margins
stay at 12 dip while the text grows. The native overflow menu and the combo's
AlertDialogareAndroid popups and follow the system font scale, not the app scale.
Checks
gjsify run check(all tsc projects),check:format,check:lint,check:versionsand the i18ngates green; catalogues regenerated with the new msgids and the German one filled.
check:metainfofails locally on a weblate 403 (url-not-reachable), environmental.Ordering, unchanged but now larger:
app-androidimports@gjsify/adwaita-nativescript/app-scale, a subpath 0.64.27 does not publish. CI here fails until agjsify release carries #2577, #2579 and #2583 together, and the dependency bump lands with it.